<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        {{ a}}
        <myheader></myheader>
    </div>
    <template id="header">
        <div>
            <hr>
            <li>我是组件</li>
            {{ num }}
            <button @click="num++">+</button>
            <hr>
        </div>
    </template>
</body>
<script src="./vue.js"></script>
<script type="module">
    const { createApp, ref } = Vue
    import myheader from './zujian.js'
    const app = createApp({
        setup() {
            let a = ref(0)
            return {
                a
            }
            return {

            }
        }
    })
    app.component('myheader', myheader)
    app.mount("#app")
</script>

</html>